﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CCS.WebApp.ViewModels.Category.Builders;
using CCS.WebApp.ViewModels.Category.Builders.Impl;

namespace CCS.WebApp.Controllers
{
    public class CategoryController : Controller
    {
        private readonly IHomePageListVmBuilder _homePageListVmBuilder;

        public CategoryController() : this(new HomePageListVmBuilder())
        {
        }

        public CategoryController(IHomePageListVmBuilder homePageListVmBuilder)
        {
            _homePageListVmBuilder = homePageListVmBuilder;
        }

        public ActionResult Index(int id)
        {
            var viewModel = _homePageListVmBuilder.CategoryListVmBuild(id);

            return View(viewModel);
        }
    }
}
